
import 'package:flutter/material.dart';
import 'package:game_score/team_plane.dart';
import 'package:game_score/timer_plane.dart';
import 'package:game_score/score_plane.dart';

void main() {
  runApp(new MaterialApp(home: new GameScoreApp()));
}

class GameScoreApp extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return new GameScoreAppState();
  }
}

class GameScoreAppState extends State<GameScoreApp> {
  static const String Default_Team1 = "Team 1";
  static const String Default_Team2 = "Team 2";


  int score1 = 0;
  int score2 = 0;
  String team1 = Default_Team1;
  String team2 = Default_Team2;

  FocusNode _focusNode1 = new FocusNode();
  FocusNode _focusNode2 = new FocusNode();


  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: AppBar(
        title: Text("Game Score"),
      ),
      body: new Padding(
        padding: EdgeInsets.all(5.0),
        child: new GestureDetector(
          onTap: () {
            _focusNode1.unfocus();
            _focusNode2.unfocus();
          },
          child: new Container(
            decoration: BoxDecoration(),
            child: new Column(
              mainAxisAlignment: MainAxisAlignment.start,
              children: <Widget>[
                new TeamPlane(focusNode1: _focusNode1, focusNode2: _focusNode2),

                new Expanded(
                  flex: 1,
                  child: new TimerPlane(),
                ),

                new Expanded(
                  flex: 2,
                  child: new ScoreCardPlane(),
                )

              ],
            ),
          ),
        ),
      ),
      resizeToAvoidBottomInset: false,
    );
  }
}